package 每日一题;

import java.util.ArrayList;
import java.util.List;

public class 旅行终点站 {
    public String destCity(List<List<String>> paths) {
        ArrayList<String> list = new ArrayList<>();
        for (List<String> path : paths) {
            list.add(path.get(0));
        }
        for (List<String> path : paths) {
            String s = path.get(1);
            if (!list.contains(s))
                return s;
        }
        return null;
    }
}
